package com.xinxuan.contentcenter.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.xinxuan.contentcenter.auth.CheckAuthorization;
import com.xinxuan.contentcenter.domain.Share;
import com.xinxuan.contentcenter.dto.ShareAuditDTO;
import com.xinxuan.contentcenter.service.ShareService;

/**
 * @author xinsl
 * @date 2021/11/23
 */
@RestController
@RequestMapping("/admin/shares")
public class ShareAdminController {

    @Autowired
    private ShareService shareService;

    @PostMapping("/audit/{id}")
    @CheckAuthorization("admin")
    public Share auditById(@PathVariable Integer id, @RequestBody ShareAuditDTO auditDTO) throws Exception {
        // TODO 认证 授权
        return shareService.auditById(id, auditDTO);
    }
}
